<?php
define("DEPLOYED",false);
require "global.php";
require_once ROOTDIR.'classes/simulator.class.php';
require_once ROOTDIR.'classes/simple_html_dom.php';

$alimama_miniurl = "http://www.alimama.com/union/minilogin.htm?style=mini&amp;proxy=http://www.alimama.com/union/proxy.htm";
$name = "liteen@126.com";
$pass = "lite82330481";

$postdata = '';

$sim = new HttpSimulator();
$sim->Open();
$content = $sim->getURLContent($alimama_miniurl,true);
$html = new simple_html_dom();
$html->load($content);
foreach($html->find("input") as $element){
	if($element->name=='_fmu.l._0.l')
		$postdata .= $element->name.'='.$name.'&';
	else if($element->name=='originalLogpasswd')
		$postdata .= $element->name.'='.$pass.'&';
	else if($element->name=='_fmu.l._0.lo')
		$postdata .= $element->name.'='.md5($pass).'&';	
	else
		$postdata .= $element->name.'='.$element->value.'&';
}
$postdata = substr($postdata,0,strlen($postdata)-1);
echo $postdata;

$content = $sim->postUrlContent($alimama_miniurl, $post_data, $alimama_miniurl,true,3);
echo $content;
?>